import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.widgets import Cursor
plt.rcParams['font.sans-serif'] = ['SimHei']
shu_ju=pd.read_excel('./学生课程成绩数据.xls')
# print(shu_ju)

data_mao=shu_ju[shu_ju['课程名称']=='毛泽东思想与中国特色社会主义理论体系概论']
data_mao=data_mao[['姓名','课程名称','分数']]
#画布大小
hua_bu=plt.figure(figsize=(12,6))
#画布位置，背景颜色
tu=hua_bu.add_subplot(111,facecolor='#f2eada')
# print(data_mao)
x=data_mao['姓名']
y=data_mao['分数']
# tu=plt.plot(x,y)
x_chui_zhi=['\n'.join(x) for x in x]
tu.plot(x_chui_zhi,y,color='#00a6ac',marker='o')
plt.xticks(fontsize=7)
plt.title('《毛泽东思想与中国特色社会主义理论体系概论》成绩分布',fontproperties='SimHei',fontsize=15,color='k',pad=30)
plt.figtext(0.5,0.9,'-----农学院15-1班',color='k',fontproperties='Kaiti',fontsize=14,ha='left')
plt.axhline(60,color='r',ls=':')
plt.axhline(90,color='r',ls=':')
plt.xlabel('学   生')
plt.ylabel('成   绩')
cursor=Cursor(tu,useblit=True,color='red',linewidth=1)
plt.show()